<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>实例成员和静态变量</title>
</head>
<body>
  <script>
    function Star (uname,uage) {
      this.uname = uname;
      this.uage = uage;
      this.sing = function () {
        console.log(this.uname + '会唱歌');
      }
    }
    var ldh = new Star('刘德华',18);
    var zxy = new Star('张学友',20);
    ldh.uage;//访问实例成员 创建实例才能访问否则为空
    Star.sex = '男';//静态成员 只能静态访问
    console.log(Star.sex);
  </script>
</body>
</html>